package cn.itsource.ymcc.openfeign.fallback;

import cn.itsource.ymcc.common.result.JsonResult;
import cn.itsource.ymcc.openfeign.UserFeignClient;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class UserFeignClientFallbackFactory implements FallbackFactory<UserFeignClient> {
    @Override
    public UserFeignClient create(Throwable throwable) {
        return new UserFeignClient() {
            @Override
            public JsonResult loginId(Long loginId) {
                //记录日志
                return JsonResult.error("loginId调用失败");
            }
        };
    }
}
